<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>歌曲添加</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">

<link rel="stylesheet"
	href="css/font.css">
<link rel="stylesheet"
	href="css/index.css">
<script src="lib/layui/layui.js"
	charset="utf-8"></script>
<script type="text/javascript"
	src="js/index.js"></script>
<script type="text/javascript"
	src="js/jquery.js"></script>
	<script type="text/javascript"
	src="js/jquery-form.js"></script>
<!--<style>
        .imgs{display: none;}
        .picture{display: none;}
    </style>-->


</head>
<body>

	<div class="layui-card">
		<form class="layui-form layui-form-pane"
			action="../../song/addSong"
			id="add-form" method="post">
			<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
				<ul class="layui-tab-title">
					<li class="layui-this">基本信息</li>
				</ul>

				<div class="layui-tab-content">
					<div class="layui-tab-item layui-show">
						<!--<form class="layui-form layui-form-pane" action="" id="add">-->
						<input type="hidden">
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>歌曲编号
							</label>
							<div class="layui-input-block">
								<input type="text" name="songId" autocomplete="off" value=""
									   class="layui-input" required = "required">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>歌曲名称
							</label>
							<div class="layui-input-block">
								<input type="text" name="songName" autocomplete="off" value=""
									   placeholder="" class="layui-input" required = "required">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>歌曲状态
							</label>
							<div class="layui-input-block">
								<input type="text" name="songStatus" autocomplete="off" value=""
									   placeholder="" class="layui-input" required = "required">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>歌曲时长
							</label>
							<div class="layui-input-block">
								<input type="text" name="songDuration" autocomplete="off" value=""
									   placeholder="" class="layui-input" required = "required">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>歌手名称
							</label>
							<div class="layui-input-block">
								<input type="text" name="singerId" autocomplete="off" value=""
									   placeholder="" class="layui-input" required = "required">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>专辑名称
							</label>
							<div class="layui-input-block">
								<input type="text" name="albumId" autocomplete="off" value=""
									   placeholder="" class="layui-input" required = "required">
							</div>
						</div>
						
						<!--<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>管理员权限编号
							</label>
							<div class="layui-input-block">
								<input type="text" name="jurisdictionId" autocomplete="off"
									value="" placeholder="" class="layui-input" required = "required">
							</div>
						</div>-->
						
						<!-- <div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>封禁
							</label>
							<div class="layui-input-block">
								<input type="checkbox" name="saleStatus" title="封禁">
							</div>
						</div> -->
						
						<!-- <div class="layui-form-item">
							<label for="link" class="layui-form-label"> <span
								class="x-red">*</span>商品图片
							</label>
							<div class="layui-input-inline">
								<div class="site-demo-upbar">
                                <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传文件</button>

                            </div>
								<input type="file" name="goodsImage" id="goodsimage">
							</div>

						</div> -->
						<!-- <div class="layui-form-item imgs" id="imgshow">
							<label class="layui-form-label">商品展示 </label> <img src=""
								id="pimages" name="pimages" style="width: 400px; height: 200px;" />
							<input id="avatar" name="image" required="" type="hidden"
								value="images">
						</div> -->


						<div class="layui-form-item">
							<button class="layui-btn" type="submit">添加歌曲</button>
						</div>
						<!--</form>-->
						<div style="height: 100px;"></div>
					</div>
				</div>
			</div>
		</form>
	</div>



    <script>


  //对指定的表单绑定提交事件
	$("#add-form").submit(function() {
		//使用jQuery.form.js插件方法ajaxSubmit()异步提交表单
		$(this).ajaxSubmit(function(result) {
			console.log(status)
			if (result.status != 0) {
				//证明歌曲添加成功
				layer.msg(result.message, {
					icon : 1,
					time : 3000
				});
				//定时器
				window.setTimeout(function(){
					
					
					//关闭子窗口
					var index = parent.layer.getFrameIndex(window.name);
					parent.layer.close(index);
					//调用首页的查询方法
					window.parent.operate();
				},3000);
			}else{
				//证明歌曲添加失败
				layer.msg(result.message, {
					icon : 5,
					time : 3000
				});
			}
		});
		//限制默认的表单
		return false;
	});
    </script>

</body>
</html>